#include "Mutex.h"

Mutex::Mutex()
{
	InitializeCriticalSection(&m_cs);
}

Mutex::~Mutex()
{
	DeleteCriticalSection(&m_cs);
}

void Mutex::lock()
{
	EnterCriticalSection(&m_cs);
}

bool Mutex::try_lock()
{
	return TryEnterCriticalSection(&m_cs);
}

void Mutex::unlock()
{
	LeaveCriticalSection(&m_cs);
}